import request from '@/utils/request'

// 列表
export function getStudyGuideList(pageNum, pageSize) {
    return request(({
        url: '/study-guide/list',
        method: 'get',
        params: {pageNum: pageNum, pageSize: pageSize,}
    }))
}

export function getStudyGuide(id) {
    return request(({
        url: '/study-guide/' + id,
        method: 'get',
        headers: {
            Authorization: localStorage.getItem('Authorization')
        }
    }))
}

export function addStudyGuide(dto) {
    return request(({
        url: '/study-guide/add',
        method: 'post',
        data: dto,
        headers: {
            Authorization: localStorage.getItem('Authorization')
        }
    }))
}

export function addStudyGuideCommnet(dto) {
    return request(({
        url: '/study-guide/comment/add',
        method: 'post',
        data: dto,
        headers: {
            Authorization: localStorage.getItem('Authorization')
        }
    }))
}

export function listStudyComment(id, pageNum, pageSize) {
    return request(({
        url: '/study-guide/comment/list',
        method: 'get',
        params: {
            id: id,
            pageNum: pageNum,
            pageSize: pageSize
        },
        headers: {
            Authorization: localStorage.getItem('Authorization')
        }
    }))
}